package com.webchat.common.service;


import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NacosDiscoveryService {

    @Autowired
    private NacosDiscoveryProperties nacosDiscoveryProperties;

    private final static String HTTP = "http://";

    public String getCurrentInstanceHost() {
        return HTTP.concat(nacosDiscoveryProperties.getIp())
                .concat(":")
                .concat(String.valueOf(nacosDiscoveryProperties.getPort()));
    }
}
